# Makefile for archive library sublib
# .f files in current directory are split in TMP directory and compiled 
# Resulting .o files are put in library
# Time of compilation of .f file is remembered by time stamp of empty .t file

HOME = /usr/rhino/people/rull
LIB= $(HOME)/sub/sublib_gen.a
INC= $(HOME)/sub/include
TMP= $(HOME)/zzztmp

.SUFFIXES: .t

.f.t:
	@mkdir $(TMP)
	cp $(*F).f $(TMP)
	@cd $(TMP); fsplit $(TMP)/$(*F).f
	@rm $(TMP)/$(*F).f
	cd $(TMP); ln -s $(INC)/* .; f77 -c $(FFLAGS) *.f
	ar -rv $(LIB) $(TMP)/*.o
	@rm $(TMP)/*
	@rmdir $(TMP)
	@touch $*.t

# Write all entries here after this general target for complete update
make:
	make calcul.t
	make job.t
	make molecule.t
	make useful.t

# Write individual dependencies here
# Include files may be present as symbolic link

calcul.t:	$(INC)/STANDFIL.INC

job.t:		$(INC)/STANDFIL.INC $(INC)/STANDDEF.INC $(INC)/COM_JOBD.INC \
		$(INC)/COM_CONST.INC $(INC)/COM_ERR.INC $(INC)/COM_ABORT.INC

useful.t:	$(INC)/STANDDEF.INC $(INC)/IO.INC

clean:
	rm $(TMP)/*
	rmdir $(TMP)
